﻿namespace FredCK.FCKeditorV2.FileBrowser
{
    using System;
    using System.Data.SqlClient;
    using System.Web;

    public class DAL
    {
        public static string GenerateStringId()
        {
            long num = 1L;
            foreach (byte num2 in Guid.NewGuid().ToByteArray())
            {
                num *= num2 + 1;
            }
            return (string.Format("{0:yyyyMMddHHmmss}", DateTime.Now) + string.Format("{0:x}", num - DateTime.Now.Ticks));
        }

        public static string getWaterImg()
        {
            string str = HttpContext.Current.Session["EntityNo"].ToString();
            string str2 = "";
            using (SqlDataReader reader = DBHelper.dataReader("select FWaterMarkSvrFileName  from t_Entity where FEntityNo='" + str + "'"))
            {
                if (reader.Read())
                {
                    str2 = reader.GetString(0);
                }
            }
            return str2;
        }

        public static string getWaterText()
        {
            string str = System.Configuration.ConfigurationManager.AppSettings["EntityNo"];
            string str2 = "";
            using (SqlDataReader reader = DBHelper.dataReader("select FTxtWaterMark  from t_Entity where FEntityNo='" + str + "'"))
            {
                if (reader.Read())
                {
                    str2 = reader.GetString(0);
                }
            }
            return str2;
        }
    }
}

